﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;

public partial class NhanVien_QuanLyLopTC : System.Web.UI.Page
{
    DataClassesDataContext data = new DataClassesDataContext();
    protected void Page_Load(object sender, EventArgs e)
    {
        if (!IsPostBack)
        {
            LoadLopTC();
        }
    }

    private void LoadLopTC()
    {
        string msgv = Session["TenDangNhap"].ToString();
        var dsloptc = from p in data.tbl_LOPTCs
                      join o in data.tbl_PHANCONGVIECs on p.MsLopTC equals o.MsLopTC
                      where o.MsGiangVien == msgv
                      select p;
        GridView_LopTC.DataSource = dsloptc;
        GridView_LopTC.DataBind();
    }
    protected void GridView_LopTC_PageIndexChanging(object sender, GridViewPageEventArgs e)
    {
        GridView_LopTC.PageIndex = e.NewPageIndex;
        LoadLopTC();
    }
    protected void GridView_LopTC_RowDataBound(object sender, GridViewRowEventArgs e)
    {
        if (e.Row.RowType == DataControlRowType.DataRow)
        {
            e.Row.Attributes.Add("onmouseover", "this.setAttribute('bgColor', this.style.backgroundColor); this.style.backgroundColor = '#FF6600';");
            e.Row.Attributes.Add("onmouseout", "this.style.backgroundColor = this.getAttribute('bgColor');");
        }
    }
}
